clc;
clear;

% 接口登入
thsLogin =THS_iFinDLogin('xnyf018','SWSC600369');

% 确定数据节点
Start_Date ='2013-12-31';
End_Date ='2024-08-02';

% 国证成长指数成分及权重
[growth,~,~,~,~,~]=THS_DR('p03563','date=20240802;index_name=399370.SZ','p03563_f001:Y,p03563_f002:Y,p03563_f003:Y,p03563_f004:Y','format:table');
growth.Properties.VariableNames(1:4) = {'date', 'code', 'name', 'weight'};

% 国证价值指数成分及权重
[value,~,~,~,~,~]=THS_DR('p03563','date=20240802;index_name=399371.SZ','p03563_f001:Y,p03563_f002:Y,p03563_f003:Y,p03563_f004:Y','format:table');
value.Properties.VariableNames(1:4) = {'date', 'code', 'name', 'weight'};

% 股票池市值及行业
[pool,~,~,~,~,~]=THS_DP('listingStockBasicInfo','001005010','code:Y,name:Y,totalCapital:Y,newSFCIndustry:Y','format:table');

% 将 data_growth 与 data_pool 连接
growth1 = join(growth, pool, 'Keys', 'code');

% 将 data_value 与 data_pool 连接
value1 = join(value, pool, 'Keys', 'code');

thsLogout = THS_iFinDLogout();